package com.yc.yyds.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "GetUserServlet", value = "/GetUserServlet.s")
public class GetUserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpSession session = request.getSession();
        String usernames = null;
        usernames = session.getAttribute("usernames").toString();
        int s=usernames.length();
        String s1=usernames.substring(10,s-1);
        System.out.println(s1);
        response.getWriter().append(s1);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
